Auto merge of #4839 - sfackler:consistent-config, r=withoutboats
authorbors <bors@rust-lang.org>
Tue, 9 Jan 2018 01:26:46 +0000 (01:26 +0000)
committerbors <bors@rust-lang.org>
Tue, 9 Jan 2018 01:26:46 +0000 (01:26 +0000)
commit4e618dd7f5acd987d3938b33e935a4e9709004db
treed6e4cf1c39fed14519b5e33243ce241a816c328f
parent9275e0d0aa69406385dfc11cd09c664472e6e539
parent5cb5e7d8f0496a3e765f6e05b95e8c3b1665036a
Auto merge of #4839 - sfackler:consistent-config, r=withoutboats

Make .cargo/credentials a subset of .cargo/config

Previously, .cargo/credentials looked like

```toml
token = "..."

[my-registry]
token = "..."
```

And was simply merged into the `registry` block of .cargo/config. This
meant that custom registry tokens were under
`registry.my-registry.token` rather than `registries.my-registry.token`
which is where the index was located, and that you couldn't have a
custom registry named `token` or it'd conflict with the token for the
default registry.

This commit changes things such that .cargo/credentials has the same
layout as .cargo/config, but only contains token values. For backwards
compatibility, we move `token` to `registry.token` when parsing.